package com.icss.controller;

import com.icss.dao.RoleDao;
import com.icss.dao.UserDao;
import com.icss.dao.tvehic;
import com.icss.entity.tvehicleillegalrecord;
import com.icss.server.tvehicleillegalrecordimpl;
import com.icss.server.tvehicleillegalrecordp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Id;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.websocket.server.PathParam;
import java.util.List;

@Controller
public class tvehcontroller {
    @Autowired
    private RoleDao rdao;
    @Autowired
    private tvehic tdao;
    @Autowired
    private UserDao udao;
    @Autowired
    private tvehicleillegalrecordimpl tv;
    @RequestMapping("/show")

    public  String fun(ModelMap mp) {
        List<tvehicleillegalrecord> all = tdao.findAll();
        mp.addAttribute("vehiclelistrecord", all);
        tvehicleillegalrecord kd = new tvehicleillegalrecord();
        System.out.println(all);
        return "index";
    }
    @GetMapping("/show")
    public tvehicleillegalrecordp getSsh(@PathParam("userId") Integer userId,
                            @PathParam("currentPage") Integer currentPage,
                            @PathParam("pageSize") Integer pageSize) {
        // 同步前端传回的当前页参数
        currentPage = currentPage - 1;
        return (Id, currentPage, pageSize);



}
